package models

import (
	"gorm.io/gorm"
	"hitme/go-api/modules/db"
)

var PhotoSpecModel = new(PhotoSpec)

// 证件照规格表
type PhotoSpec struct {
	db.CommonModel
	SpecId   uint64 `gorm:"default:0;NOT NULL;comment:规格ID" json:"spec_id"`
	SpecName string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格名称" json:"spec_name"`
	SpecPx   string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格像素" json:"spec_px"`
	SpecSize string `gorm:"type:varchar(100);default:'';NOT NULL;comment:规格冲印大小" json:"spec_size"`
	Name     string `gorm:"type:varchar(100);default:'';comment:名称" json:"name"`
	IsHot    int8   `gorm:"type:tinyint(1);default:0;comment:是否热门" json:"is_hot"`
	CateName string `gorm:"type:varchar(255);default:'';comment:分类" json:"cate_name"`
}

func (m *PhotoSpec) TableName() string {
	return "photo_spec"
}

func (m *PhotoSpec) Model() *gorm.DB {
	return db.MysqlDB.Model(&m)
}